package com.render3d.ms3d;

import javax.vecmath.*;

public class MS3DTriangle {

    public short                            flags;
    public short                            vertexIndices[];
    public Vector3f                         vertexNormals[];
    public TexCoord2f                       texCoord[];
    public byte                             smoothingGroup;
    public byte                             groupIndex;
    
    public MS3DTriangle() {
        vertexIndices = new short[3];
        vertexNormals = new Vector3f[3];
        texCoord = new TexCoord2f[3];
    }
    @Override
    public Object clone() throws CloneNotSupportedException {
    	// TODO Auto-generated method stub
    	MS3DTriangle ms3dTriangle = new MS3DTriangle();
    	ms3dTriangle.flags = flags;
    	ms3dTriangle.smoothingGroup = smoothingGroup;
    	ms3dTriangle.groupIndex = groupIndex;
    	int size = vertexIndices.length;
    	ms3dTriangle.vertexIndices = new short[size];
    	for(int i = 0;i < size;i++){
    		ms3dTriangle.vertexIndices[i] = vertexIndices[i];
    	}
    	size = vertexNormals.length;
    	ms3dTriangle.vertexNormals = new Vector3f[size];
    	for(int i = 0;i < size;i++){
    		ms3dTriangle.vertexNormals[i] = new Vector3f(vertexNormals[i]);
    	}
    	size = texCoord.length;
    	ms3dTriangle.texCoord = new TexCoord2f[size];
    	for(int i = 0;i < size;i++){
    		ms3dTriangle.texCoord[i] = new TexCoord2f(texCoord[i]);
    	}
    	return ms3dTriangle;
    }    
}
